#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
bool IsCharAndNum(char str)
{
    if ((str >= 'a' && str <= 'z') || (str >= 'A' && str <= 'Z') || (str >= '0' && str <= '9'))
    {
        return true;
    }
    return false;
}
bool isPalindrome(char* s)
{
    int len = (int)strlen(s);
    char* tmp = (char*)malloc(sizeof(char) * len);
    int k = 0;
    while (*s != '\0')
    {
        if (IsCharAndNum(*s))
        {
            if (*s >= 'A' && *s <= 'Z')
            {
                *s = *s + 32;
            }
            tmp[k++] = *s;
        }
        s++;
    }
    int left = 0, right = k - 1;
    while (left < right)
    {
        if (tmp[left] != tmp[right])
        {
            return false;
        }
        left++;
        right--;
    }
    return true;
}
int main()
{
    char s[] = "A man, a plan, a canal: Panama";
    printf("%d\n", isPalindrome(s));
    return 0;
}